package com.atguigu.aiproject.mapper;

import com.atguigu.aiproject.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface AdminMapper {
    @Select("${sql}")
    void executeSql(String sql);

    // 修改返回类型为 List<Map<String, Object>> 以处理多个结果
    @Select("${sql}")
    List<Map<String, Object>> selectSql(String sql);

    List<User> getUsersByIds(List<Integer> userIds);

    @Select("SELECT u_role FROM users WHERE u_id = #{userId}")
    int getUserRoleById(int userId);
}
